package com.rowe.SqlSetup;

import android.app.Activity;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;

public class SqlSetup extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        SQLiteDatabase myDatabase;
        
        myDatabase = openOrCreateDatabase( "/mnt/sdcard/UDVT/UDVirtualTour.db", SQLiteDatabase.CREATE_IF_NECESSARY, null); 
        myDatabase.execSQL("DROP TABLE IF EXISTS UDVirtualTour");
        myDatabase.execSQL("CREATE TABLE IF NOT EXISTS UDVirtualTour" +
        	    "(id INTEGER," +
        	    " filename VARCHAR(200), " +
        	    " lat INTEGER, " +
        	    " long INTEGER, " +
        	    " info LONGTEXT, " +
        	    " pictureLink TEXT, " +
        	    " audioLink TEXT);");
        
        ContentValues values = new ContentValues();
        values.put("id", 1);
        values.put("filename", "Evans");
        values.put("lat","3968019737");
        values.put("long","-7575163479");
        values.put("info", "Evans Hall is named in memory of George G. Evans and Charles Black Evans, father and son, respectively, who were members of the Board of Trustees.  Through bequests, the Evans family has provided more than $1.4 million to UD.  Evans Hall houses the Department of Electrical and Computer Engineering.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Evans.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Evans.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 2);
        values.put("filename", "Dupont");
        values.put("lat","3968063784");
        values.put("long","-7575192790");
        values.put("info", "P.S. du Pont Hall is named in memory of Pierre S. du Pont, a major benefactor of the University. The building houses classrooms and laboratories for the College of Engineering. In 2002, a major $27 million expansion and renovation of the building was completed. Included was the addition of a new three-story front to the building. This was designed by renowned Georgian architect Allan Greenberg, who also designed Gore Hall, which sits across The Green from du Pont.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Dupont.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Dupont.mp3");       
        myDatabase.insert("UDVirtualTour",null,values);
        
        
        values = new ContentValues();
        values.put("id", 3);
        values.put("filename", "Wolf");
        values.put("lat","3968118335");
        values.put("long","-7575211182");
        values.put("info", "Wolf Hall is named in memory of Theodore Wolf, professor of chemistry, 1871-1909. The College of Agricultural Sciences occupied the building from 1917-1951. Currently it houses the Departments of Psychology and Biological Sciences. A major renovation of this building was completed in 2003.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Wolf.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Wolf.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        
        
        values = new ContentValues();
        values.put("id", 4);
        values.put("filename", "Trabant");
        values.put("lat","3968183700");
        values.put("long","-7575383600");
        values.put("info", "The 107,000-square-foot Trabant University Center includes a food court, a box office, a large multipurpose room with seating for 700 people and the YoUDee Shop. The facility includes a state-of-the-art movie theatre, offices, and meeting rooms.  Trabant is also the home to Daugherty Hall, a quiet study lounge, and Vita Nova, the award-winning restaurant run by students in UD's Department of Hotel Restaurant and Institutional Management.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Trabant.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Trabant.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        
        
        values = new ContentValues();
        values.put("id", 5);
        values.put("filename", "Sharp");
        values.put("lat","3968109578");
        values.put("long","-7575262053");
        values.put("info", "Sharp Laboratory is named in honor of H. Rodney Sharp, a student of the class of 1900 who also served as a member of the Board of Trustees from 1915-1968.  Sharp Lab contains offices and classrooms for the Department of Physics and Astronomy and the Bartol Research Institute, and houses the Institute's 38-ton cosmic ray detector.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Sharp.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Sharp.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        
        
        
        values = new ContentValues();
        values.put("id", 6);
        values.put("filename", "Gore");
        values.put("lat","3968061643");
        values.put("long","-7575247956");
        values.put("info", "Gore Hall opened in 1998. The $17.5 million high-tech classroom building was a gift from the Gore family.  Noted architect Allan Greenberg, a specialist in Georgian architecture, designed the building, which contains 25 classrooms and the Center for Teaching and Learning.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Gore.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Gore.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 7);
        values.put("filename", "Mitchell");
        values.put("lat","3968010940");
        values.put("long","-7575282360");
        values.put("info", "Mitchell Hall was the gift of H. Rodney Sharp and named in honor of Samuel Chiles Mitchell, president of Delaware College, 1914-1920. Extensive renovations have made it one of the finest small theatres in the area that is used extensively for musical and theatrical performances, lectures and political debates.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Mitchell.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Mitchell.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 8);
        values.put("filename", "Hullihen");
        values.put("lat","3967956929");
        values.put("long","-7575244498");
        values.put("info", "During its early years of service, Hullihen Hall was named /'University Hall/'. In 1952, it was renamed in memory of Walter Hullihen, president of the University from 1920-1944 (the longest presidency in UD history). It is the central administration building, housing the Offices of the President, Vice Presidents, and Provost.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Hullihen.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Hullihen.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 9);
        values.put("filename", "Memorial");
        values.put("lat","3967936227");
        values.put("long","-7575217119");
        values.put("info", "Memorial was erected by the citizens of Delaware as the state's memorial of World War I, and is currently listed on the National Register of Historic Places. Memorial Hall served as the University Library from 1924-1963. It underwent a major $9.8 million renovation in 1999 and now houses the Department of English.  A book, displayed on a podium in the lobby, features the name of one Delawarean who died in the war on each page, and one page is turned each day.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Memorial.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Memorial.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 10);
        values.put("filename", "Morris");
        values.put("lat","3967809337");
        values.put("long","-7575229645");
        values.put("info", "Morris Library was opened in 1963 and  is named for alumnus Judge Hugh Morris who was a member of the Board of Trustees for 30 years and president of the board from 1939-1959. In 1986, a $14 million addition to the library doubled the space for books and readers. Students have been known to rub the nose on the statue of Hugh Morris in the library’s lobby for good luck before exams.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Morris.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Morris.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 11);
        values.put("filename", "Perkins");
        values.put("lat","3967703700");
        values.put("long","-7574984800");
        values.put("info", "Named in memory of John A. Perkins, president of the University from 1950-1967, the Perkins Student Center contains student organization offices, meeting rooms, lounges, The Scrounge, The Hen Zone, the Bacchus Theatre and the University Bookstore. It is also the home of The UD Review, the student newspaper, and WVUD, the campus radio station.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Perkins.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Perkins.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        values = new ContentValues();
        values.put("id", 12);
        values.put("filename", "Brown");
        values.put("lat","3967963200");
        values.put("long","-7575192100");
        values.put("info", "Brown Laboratory is named in memory of H. Fletcher Brown, a member of the Board of Trustees, (1929-1944) and a benefactor. The building houses the Department of Chemistry and Biochemistry. A recent $28 million renovation added a 4,000-square-foot magnet hall designed to accommodate nuclear magnetic resonance equipment.");
        values.put("pictureLink", "/mnt/sdcard/UDVT/Brown.jpg");
        values.put("audioLink", "/mnt/sdcard/UDVT/Brown.mp3");
        myDatabase.insert("UDVirtualTour",null,values);
        
        
        Cursor c = myDatabase.query("UDVirtualTour", null, null, null, null, null, null);
        c.moveToLast();
        String Count = Integer.toString(c.getCount());
        Log.d("SQL TEST",c.getString(0));
        Log.d("SQL TEST",c.getString(1));
        Log.d("SQL TEST",c.getString(2));
        Log.d("SQL TEST",c.getString(3));
        Log.d("SQL TEST",c.getString(4));
        Log.d("SQL TEST",c.getString(5));
        Log.d("SQL TEST",c.getString(6));
        Log.d("SQL TEST",Count);
       
        	
   
        
    }
}